Practical Discrete Mathematics by Ryan T. White and Archana Tikayat Ray

Practical Discrete Mathematics by Ryan T. White and Archana Tikayat Ray

Author:Ryan T. White and Archana Tikayat Ray
Language: eng
Format: mobi
Publisher: Packt Publishing Ltd.
Published: 2021-01-20T16:00:00+00:00


Figure 7.2 – Time and space complexity comparison for different algorithms

Oftentimes, there are multiple ways to solve a problem. However, we need to find the most efficient way to achieve this. To do this, we need to be able to quantify the performance of the different algorithms used and choose the best one. There are two things that are crucial while comparing the performance of algorithms, namely:

Time required: This quantifies the amount of time required to run an algorithm to its completion as a function of length of the input.Time requirements can be defined as a numerical function F(n), where F(n) is measured as the number of steps, provided all steps consume the same amount of time.

Let's say that the addition of two bits takes c seconds, hence, if we try to add n-bit integers, it will take F(n) = n * c seconds. Hence, we can conclude that F(n) has a linear growth as the size of the input increases.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.